﻿namespace ProjectAutumn
{
    public struct Rectangle
    {
        public int X;
        public int Y;
        public int Width;
        public int Height;
        public Rectangle(int x, int y, int width, int height)
        {
            X = x;
            Y = y;
            Width = width;
            Height = height;
        }
        public bool Intersects(Rectangle value)
        {
            return ((((value.X < (X + Width)) && (X < (value.X + value.Width))) && (value.Y < (Y + Height))) && (Y < (value.Y + value.Height)));
        }
        public int Left
        {
            get
            {
                return X;
            }
        }
        public int Top
        {
            get
            {
                return Y;
            }
        }
        public int Right
        {
            get
            {
                return X + Width;
            }
        }
        public int Bottom
        {
            get
            {
                return Y + Height;
            }
        }
    }
}
